package springframework.bean;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Cedric
 * @date 2021/11/19 09:58
 * @description 被引用bean组件
 */
public class UserDao {
    private static Map<String, String> hashMap = new HashMap<>();

    public void initDataMethod() {
        System.out.println("执行init方法");
        hashMap.put("10001", "cedric");
        hashMap.put("10002", "it-farmer");
    }

    public void destroyDataMethod() {
        System.out.println("执行clear方法");
        hashMap.clear();
    }

    public String queryUserName(String uid) {
        return hashMap.get(uid);
    }
}
